from system.action import Action
from system.object import Object

class TestAction(Action):
    def run(self, num = 3):
        self.log("run", num)
        
        workers = [self.object.runAction("worker.worker") for i in range(num)]
        self.log(workers,[self.object.call(worker, "work", num = i) for i, worker in enumerate(workers)])
        #defers = [self.object.defer(worker, "work", num = i) for i, worker in enumerate(workers)]
        #self.log(workers,[defer() for defer in defers])
        
        self.wait()
